home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / DATABASE.DIR / 00105_Script_TIMELINE BUTTON < prev    next >
Text File  |  1996-03-28  |  2KB  |  67 lines

  1. -- --------------------------------------------------------------
  2. -- Handler clickTimeLineButton is called when the user clicks the
  3. -- timeLine button
  4.  
  5. on clickTimeLineButton
  6.   global timeLineButton
  7.   
  8.   activateButtonThenEnable(timeLineButton)
  9.   doTimeLine
  10. end
  11.  
  12. -- --------------------------------------------------------------
  13. -- Handler doTimeLine jumps to the proper screen in the timeline.
  14.  
  15. on doTimeLine
  16.   global clickedTopic, dataTimeLineMapping
  17.   
  18.   set theLine = getTimeLineScene(clickedTopic)
  19.   
  20.   -- ERROR HANDLING
  21.   if (theLine = 0) then
  22.     exit
  23.   else
  24.     set the itemDelimiter = ":"
  25.     set theScene = item 2 of line theLine of dataTimeLineMapping
  26.     set the itemDelimiter = ","
  27.     goScene(theScene)
  28.     initializeTimeline
  29.   end if
  30. end
  31.  
  32. -- --------------------------------------------------------------
  33. -- Handler getTimeLineScene returns the frame in the timeline to
  34. -- jump to.
  35.  
  36. on getTimeLineScene whichTopic
  37.   global dataTimeLineMapping
  38.   
  39.   return binSearchFirstItemInLine(dataTimeLineMapping, whichTopic, ":")
  40. end
  41.  
  42.  
  43. -- --------------------------------------------------------------
  44. -- Handler setDataTimeLineMapping sets up the data in field 
  45. -- dataTimeLineMapping which contains a list of all topics from
  46. -- which the user can jump to the timeline and the associated
  47. -- marker in the timeline.
  48.  
  49. on setDataTimeLineMapping
  50.   set theMapping = EMPTY
  51.   
  52.   set the itemDelimiter = ":"
  53.   
  54.   repeat with i = 1 to the number of lines in field "Button States"
  55.     set theTopic = item 1 of line i of field "Button States"
  56.     set timelineState = value(word 2 of item 2 of line i of field "Button States")
  57.     
  58.     if timelineState then
  59.       put theTopic & ":" & RETURN after theMapping
  60.     end if
  61.   end repeat
  62.   
  63.   set the itemDelimiter = ","
  64.   
  65.   put theMapping into field "DataTimeLineMapping"
  66. end
  67.